load("@rules_rust//rust:defs.bzl", "rust_doc", "rust_library", "rust_test")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "//packages/ic-error-types",
    "//rs/consensus/utils",
    "//rs/crypto",
    "//rs/interfaces",
    "//rs/interfaces/registry",
    "//rs/interfaces/state_manager",
    "//rs/monitoring/logger",
    "//rs/monitoring/metrics",
    "//rs/phantom_newtype",
    "//rs/protobuf",
    "//rs/registry/helpers",
    "//rs/registry/subnet_features",
    "//rs/replicated_state",
    "//rs/types/management_canister_types",
    "//rs/types/types",
    "@crate_index//:num-traits",
    "@crate_index//:prometheus",
    "@crate_index//:rayon",
    "@crate_index//:slog",
]

DEV_DEPENDENCIES = [
    # Keep sorted.
    "//rs/artifact_pool",
    "//rs/consensus/mocks",
    "//rs/registry/fake",
    "//rs/registry/keys",
    "//rs/test_utilities",
    "//rs/test_utilities/registry",
    "//rs/test_utilities/state",
    "//rs/test_utilities/types",
    "//rs/types/types_test_utils",
    "@crate_index//:assert_matches",
    "@crate_index//:prost",
    "@crate_index//:strum",
]

rust_library(
    name = "vetkd",
    srcs = glob(["src/**/*.rs"]),
    crate_features = select({
        "//conditions:default": [],
    }),
    crate_name = "ic_consensus_vetkd",
    proc_macro_deps = [
        # Keep sorted.
        "@crate_index//:strum_macros",
    ],
    version = "0.9.0",
    deps = DEPENDENCIES,
)

rust_doc(
    name = "consensus_vetkd_doc",
    crate = ":vetkd",
)

rust_test(
    name = "consensus_vetkd_test",
    crate = ":vetkd",
    deps = DEPENDENCIES + DEV_DEPENDENCIES,
)
